#!/bin/bash
PASSWORD=$(zenity --password --title "密码默认1234")
echo $PASSWORD | sudo -S ls &> /dev/null
if [ "$device_name" != "steamdeck" ] || [ "$user" != "1000" ]; then
  zenity --question --width=400 \
  --text="提示：更新会删除之前所有的Ge兼容层,只保留最新版本        淘宝:SteamDeck超人.当前将更新版本为10-25 \
  \n现在是否开始更新?"
  if [ "$?" != 0 ]; then
    #NOTE: This code will never be reached due to "set -e", the system will already exit for us but just incase keep this
    echo "bye then! xxx"
    exit 1;
  fi
fi
sudo rm -rf /home/deck/SteamDeck超人/GE-Proton.sh
wget -P /home/deck/SteamDeck超人/ https://gitee.com/chaoren0113/GE-Proton/raw/master/GE-Proton.sh
sudo sh /home/deck/SteamDeck超人/GE-Proton.sh
echo $?
sudo rm -rf /home/deck/SteamDeck超人
sudo rm -rf /tmp/steamdeck.sh
echo "Done."
